<template>
  <view class="common-container">
    <view class="menu-l-wrap" v-for="(menu, index) in menuOption" :key="index">
      <view class="menu-i" :data-link="menu.link" @tap="onRedirectPage">
        <view class="menu-t">{{menu.label}}</view>
        <image class="icon-g" src="/static/images/ic_go.png" />
      </view>
    </view>
  </view>
</template>

<script>
const MENU_OPTION = [
  {
    label: "修改密码",
    link: "editPassword"
  },
  {
    label: "设置用户名",
    link: "editUserName"
  }
];
export default {
  data() {
    return {
      menuOption: MENU_OPTION
    };
  },
  methods: {
    onRedirectPage(e) {
      let { link } = e.currentTarget.dataset;
      this.$openPage(link);
    }
  }
};
</script>

<style lang="scss" scoped>
.menu-l-wrap {
  background: #ffffff;
  margin-top: 20rpx;
  .menu-i {
    height: 92rpx;
    line-height: 92rpx;
    //padding: 0 24rpx;
    padding-right: 24rpx;
    margin-left: 24rpx;
    display: flex;
    align-items: center;
    border-top: 1px solid #ededed;
    .icon-b {
      width: 44rpx;
      height: 44rpx;
    }
    .icon-g {
      width: 36rpx;
      height: 36rpx;
    }
    .menu-t {
      flex: 1;
      font-size: 30rpx;
      margin-left: 20rpx;
    }

    .menu-logout {
      text-align: center;
      flex: 1;
      font-size: 30rpx;
    }
  }
  .menu-i:first-child {
    border-top: 0;
  }
}
</style>